﻿<%@ Page EnableEventValidation="true" Language="C#" AutoEventWireup="true" CodeBehind="DoWJ.aspx.cs"
    Inherits="CSM.Views.Kefu.DoWJ" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <script type="text/javascript" src="../../Js/jquery-1.4.3.min.js"></script>

    <link href="../../App_Themes/Default_1/jquery-datepicker.css" rel="stylesheet" type="text/css"/>
    <script  type="text/javascript" src="../../Js/jquery-datepicker.js"></script> 
    
    <script src="../../Js/jquery.autocomplete.min.js" type="text/javascript"></script>

    <link href="../../App_Themes/Default_1/jquery.autocomplete.css" type="text/css" rel="stylesheet" />

    <script language="javascript" type="text/javascript">
        //直接由数组获得 
        $(document).ready((function() {
        //由SERVER端获得
        $("#TextBox_BeginTime").datepicker();
        $("#TextBox_EndTime").datepicker();
        $("#txtOrder").autocomplete("../Management/GetData.ashx?database=TCrm_KF_Customer&which=CustomerID");
        $("#TextBox_Product").autocomplete("../Management/GetData.ashx?database=TCrm_KF_Product&which=ProductID");
        }
));
        function AddRemoveValues(oChk)    //选择或反选单项时调用的function
        {
            if (oChk.checked) {
                document.getElementById('TextBox1').value += oChk.value + ",";
                var allSelect = true;
                for (var i = 0; i < form1.elements.length; i++) {
                    if (form1.elements[i].type == "checkbox") {
                        if (form1.elements[i].checked == false && form1.elements[i].id != "chk_SelectAll") {
                            allSelect = false;
                        }
                    }
                }

                if (allSelect) {
                    //document.getElementById('chk_SelectAll').checked = true;
                }
            }
            else {
                document.getElementById('TextBox1').value = document.getElementById('TextBox1').value.replace(oChk.value + ",", "");
                //document.getElementById('chk_SelectAll').checked = false;
            }
        }

        function selectAll(chkAll)   //全选或反选时调用的function
        {
            if (chkAll.checked) {
                var txt = document.getElementById('TextBox1');
                for (var i = 0; i < form1.elements.length; i++) {
                    if (form1.elements[i].type == "checkbox") {
                        form1.elements[i].checked = true;
                        if (form1.elements[i].value != "on") {
                            txt.value += form1.elements[i].value + ',';
                        }
                    }
                }
            }
            else {
                for (var i = 0; i < form1.elements.length; i++) {
                    if (form1.elements[i].type == "checkbox") {
                        form1.elements[i].checked = false;
                    }
                }
                document.getElementById('TextBox1').value = '';
            }
        }


    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Panel ID="Panel_Gridlist" runat="server">
        <table>
        <tr><td>
           <asp:Label ID="Label_ShopId" runat="server" SkinID="Label" Text="店铺："></asp:Label></td>
            <td><asp:DropDownList ID="DropDownList_ShopId" runat="server"></asp:DropDownList></td>
            <td><asp:Label ID="Label12" runat="server" SkinID="Label" Text="客户ID："></asp:Label></td>
        <td><asp:TextBox ID="txtOrder" runat="server" SkinID="TextBox"></asp:TextBox></td>
        <td><asp:Label ID="Label13" runat="server" SkinID="Label" Text="省份："></asp:Label></td>
        <td><asp:DropDownList ID="DropDownList_Provinces" runat="server">
        </asp:DropDownList></td></tr>
        <tr><td><asp:DropDownList ID="DropDownList_Key" runat="server">
            <asp:ListItem Value="">选择关键词</asp:ListItem>
            <asp:ListItem Value="Ali">旺旺ID</asp:ListItem>
            <asp:ListItem Value="Order">订单编号</asp:ListItem>
            <asp:ListItem Value="Phone">电话</asp:ListItem>
            <asp:ListItem Value="Receiver">收货人姓名</asp:ListItem>
        </asp:DropDownList></td>
        <td><asp:TextBox ID="TextBox_Key" runat="server" SkinID="TextBox"></asp:TextBox></td>
        <td><asp:Label ID="Label20" runat="server" SkinID="Label" Text="产品ID："></asp:Label></td>
        <td><asp:TextBox ID="TextBox_Product" runat="server" SkinID="TextBox"></asp:TextBox></td></tr>
        <tr><td><asp:Label ID="Label18" runat="server" SkinID="Label" Text="金额区间："></asp:Label></td>
        <td><asp:TextBox ID="TextBox_Min" runat="server" SkinID="TextBox"></asp:TextBox></td>
        <td><asp:TextBox ID="TextBox_Max" runat="server" SkinID="TextBox"></asp:TextBox></td></tr>
        <tr>
                    <td><asp:Label ID="Label_BeginTime" runat="server" SkinID="Label" Text="时间区间："></asp:Label></td>
                    <td><asp:TextBox ID="TextBox_BeginTime" runat="server" SkinID="TextBox" 
                       ></asp:TextBox></td>
                    <td><asp:TextBox ID="TextBox_EndTime" runat="server" skinid="TextBox" ></asp:TextBox></td>
                    </tr></table>
            <asp:Button ID="Button_Browse" runat="server" Text="查询" SkinID="Button" OnClick="MyClick" />

             <asp:Panel ID="Panel_Browse" runat="server" Visible="False">
            <asp:LinkButton ID="LinkButton_First" runat="server" CommandArgument="First" OnClick="MyClick"><img src = "../../App_Themes/Default_1/Images/Page_First.gif" class = "Page_First"alt = "首页" /></asp:LinkButton>
            <asp:LinkButton ID="LinkButton_Prev" runat="server" CommandArgument="Prev" OnClick="MyClick"><img  src = "../../App_Themes/Default_1/Images/Page_Prev.gif" class = "Page_Prev"  alt = "上页"/></asp:LinkButton>
            <asp:LinkButton ID="LinkButton_Next" runat="server" CommandArgument="Next" OnClick="MyClick"><img  src = "../../App_Themes/Default_1/Images/Page_Next.gif"  class = "Page_Next"  alt = "下页"/></asp:LinkButton>
            <asp:LinkButton ID="LinkButton_Last" runat="server" CommandArgument="Last" OnClick="MyClick"><img   src = "../../App_Themes/Default_1/Images/Page_Last.gif" class = "Page_Last" alt = "末页"/></asp:LinkButton>
            <asp:Label ID="Label_Total" runat="server" SkinID="Label" Text="共："></asp:Label>
            <asp:Label ID="Label_CurrenPageAndTo" runat="server" SkinID="Label" Text="页，当前第 页，转到"></asp:Label>
            <asp:TextBox ID="TextBox_PageIndex" runat="server" Width="26px"></asp:TextBox>
            <asp:Label ID="Label4" runat="server" SkinID="Label" Text="页"></asp:Label>
            <asp:RangeValidator ID="RangeValidator_PageIndex" runat="server" ControlToValidate="TextBox_PageIndex"
                ErrorMessage="*" MaximumValue="10000" MinimumValue="1" Type="Integer"></asp:RangeValidator>
            <asp:Button ID="Button_PageGo" runat="server" CommandArgument="GotoPage" OnClick="MyClick"
                SkinID="Button" Text="GO" />
                <asp:Button ID="Button_Black" runat="server" CommandArgument='<%# Eval("CustomerID") %>'
                                OnCommand="Button_Black_Command" Text="加入黑名单" SkinID="Button" OnClientClick="return confirm('你确定要将客户加入黑名单吗？')" />
            <asp:Button ID="Button_NoCall" runat="server" CommandArgument='<%# Eval("CustomerID") %>'
                                OnCommand="Button_NoCall_Command" Text="加入免打扰" SkinID="Button" OnClientClick="return confirm('你确定要将客户加入免打扰吗？')" />
            <asp:GridView ID="GridView_Orders" runat="server" AutoGenerateColumns="False" SkinID="gridview">
                <Columns>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="center">
                    <HeaderTemplate>
                        <asp:CheckBox id="chk_SelectAll" Text="全选" runat="server" checked="false" onclick="javascript:return selectAll(this)" />
                    </HeaderTemplate>
                   <ItemTemplate>                   
                      <input type="checkbox" id="chkSelect" runat="server" checked="false" onclick="AddRemoveValues(this)" value='<%# Eval("CustomerID") %>' name="chkSelect"/>                                  
                   </ItemTemplate>
                </asp:TemplateField>
                    <asp:BoundField DataField="TbID" HeaderText="淘宝ID" ReadOnly="True" 
                        SortExpression="淘宝ID" />
                     <asp:BoundField DataField="AllMoney" HeaderText="累计消费" ReadOnly="True" 
                        SortExpression="累计消费" />
                    <asp:BoundField DataField="CustomerName" HeaderText="客户名称" ReadOnly="True" 
                        SortExpression="客户名称" />
                    <asp:BoundField DataField="MobliePhone" HeaderText="电话号码" ReadOnly="True" 
                        SortExpression="电话号码" />
                    <asp:BoundField DataField="Address" HeaderText="地址" ReadOnly="True" 
                        SortExpression="地址" />
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:Button ID="Button_CallBack" runat="server" CommandArgument='<%# Eval("CustomerID") %>'
                                OnCommand="Button_CallBack_Command" Text="问卷" SkinID="Button" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            </asp:Panel>
        </asp:Panel>
        <input id="TextBox1" runat="server" style="width: 39px" type="hidden" />
        <asp:HiddenField ID="CurrentPage" runat="server" Value="0" />
                <asp:HiddenField ID="HiddenField1" runat="server" Value="0" />
          <asp:HiddenField ID="HiddenField_DefaultStat" runat="server" Value="0" />
    </div>
    </form>
</body>
</html>
<% =alert %>
